home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / AMOS / AMOSList-0697 / AMOSLIST / text0262.txt < prev    next >
Encoding:
Text File  |  1997-07-03  |  1.6 KB  |  56 lines

  1. Robert,  looks like you'll have to use a Collision / Zone combo 
  2. to detect a collision within a Limit Bob defined area. Try This:
  3.  
  4. Ink 3 : Bar 0,0 To 20,20
  5. Reserve Zone 1
  6. Get Bob 1,0,0 To 20,20
  7. Box 0,50 To 64,90
  8. Wait Vbl
  9. Limit Bob 1,0,50 To 64,90
  10. Set Zone 1,0,50 To 64,90
  11. Do 
  12.    X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  13.    Bob 2,X,Y,1
  14.    Wait Vbl
  15.    If Zone(X,Y)
  16.       If Bob Col(2)
  17.          Boom
  18.       End If
  19.    End If
  20. Loop
  21.  
  22. -----Original Message-----
  23. From:    Robert W. Benjamin [SMTP:sosbbs.com@mail1.access.digex.net]
  24. Sent:    Friday, June 27, 1997 1:45 AM
  25. To:    Amos List
  26. Subject:    The Unseen Bob
  27.  
  28. I am working on an AMOS project, a simple shooter for the AMIGA Public
  29. Domain.
  30. While coding the game, I have run into a problem:
  31.      I have a scene where an enemy slides up and comes into view in a window
  32.      of a building. The enemy is on the screen all the time, but I have set
  33. it's
  34.       'BOB LIMIT' to the size of the window, so the only time you see the
  35. enemy
  36.       is when it slides up into the 'BOB LIMIT' view area.
  37.       
  38.       The problem is, if i want another 'BOB' to detect a collision with
  39. the 'BOB'
  40.        in the window, it detects a collision with the 'BOB' even if it's
  41. under the
  42.        window (NOT IN THE 'BOB LIMIT' AREA). The 'BOB' does'nt even have
  43.        to be visible on the screen (IN THE 'BOB LIMIT' AREA), to detect a 
  44.        collision.
  45.  
  46. Why does it detect a collision, with a part that's not being drawed on the
  47. screen?
  48. is it because collisions are based on the X and Y positions? Or because AMOS
  49. looks at the size of the 'BOB' images in the .abk 'BOB' bank to check for
  50. collisions?
  51.  
  52. Robert W. Benjamin
  53. rwbenjamin@sosbbs.com
  54.  
  55.  
  56.